package org.tarena.dang.service;

import java.sql.SQLException;
import java.util.List;

import org.tarena.dang.dao.OrderDAO;
import org.tarena.dang.dao.impl.OrderDAOImpl;
import org.tarena.dang.entity.CartItem;
import org.tarena.dang.entity.User;
import org.tarena.dang.entity.UserAdress;


public class OrderServiceImp implements OrderService {
	OrderDAO dao = new OrderDAOImpl();
	@Override
	public boolean insertAdd(int id, UserAdress adress) throws SQLException {
		return dao.insertAdd(id,adress);
	}
	@Override
	public int saveItems(int id, CartItem c) throws SQLException {
		
		return dao.saveItems(id,c);
	}
	@Override
	public int saveOrder(int id, UserAdress address, double count,
			int waitPay, long currentTimeMillis) throws SQLException {
		
		return dao.saveOrder(id,address,count,waitPay,currentTimeMillis);
	}
	@Override
	public List<UserAdress> getAddress(int id) throws SQLException {
		List<UserAdress> address = dao.getAddress(id);
		return address;
	}
	@Override
	public UserAdress getAddById(int addId) throws SQLException {
		UserAdress add = dao.getAddById(addId);
		return add;
	}

}
